perfect_numbers = []

for num in range(1, 1000):
    factors = []
    for i in range(1, num):
        if num % i == 0:
            factors.append(i)
    if sum(factors) == num:
        perfect_numbers.append(num)

print(perfect_numbers)
